<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class UserData extends MY_Controller {

	function __construct(){
		parent::__construct();
		
	}
	
	//买卡记录
	function buy_cart(){
		$user_id = $this->user_id;	
		
		$page		= $this->input->post('page');
		$size		= $this->input->post('size');
		
		if($page<1)$page=1;
		if($size<1)$size=10;
		
		$arr = array(
			"user_id" =>$user_id
		);
		
		$this->load->model('User/UserCartModel','cart');
		
		$res = $this->cart->get_list($arr,$page,$size);
		if(($page-1)*$size>$res['count']){
			$this->err_out('没有了',10);
		}
		
		$data['result_code'] = 0;
		$data['message']     = '获取列表成功';
		$data['data'] = array('count'=>$res['count'],'list'=>$res['list']);
	
		$this->out($data);
	}
	
	
	
	
	
}
